package com.qfedu.yanglao20admin.advice.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qfedu.yanglao20.entity.advice.Advice;
import com.qfedu.yanglao20admin.advice.dao.AdviceDao;
import com.qfedu.yanglao20admin.advice.service.AdviceService;
import com.qfedu.yanglao20admin.advice.vo.AdviceVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Advice)表服务实现类
 *
 * @author makejava
 * @since 2023-04-19 20:02:54
 */

@Service()
public class AdviceServiceImpl extends ServiceImpl<AdviceDao, Advice> implements AdviceService {

    @Resource
    private AdviceDao adviceDao;


    /**
     * 分页查询
     *
     * @param current
     * @param size
     * @return
     */
    @Override
    public Page<AdviceVO> advicePage(Integer current, Integer size) {

        Page<AdviceVO> advicePage = new Page<>(current, size);

        List<AdviceVO> advice = adviceDao.selectList(current, size);

        advicePage.setRecords(advice);
        return advicePage;
    }
}
